<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="keywords" content="">
    <meta name="author" content="">
    <meta name="robots" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        html, body {
            width: 100%;
            overflow-y:hidden;
        }
        .modal-backdrop {
            opacity: 0 !important;
            filter: alpha(opacity=0) !important;
        }
    </style>

    <!-- PAGE TITLE HERE -->
    <title>Jobick Job Admin</title>

    <link href="../../static/css/nice-select.css" rel="stylesheet">

    <!-- Style css -->
    <link href="../../static/css/style.css" rel="stylesheet">

</head>
<body>

<div class="container-fluid">
    <div class="row">
        <div class="col-xl-12">
            <div class="profile-back">
                <img src="../../static/picture/profile1.jpg" alt="">
                <div class="social-btn">
                    <a href="#" class="btn btn-light social">245 关注</a>
                    <a href="#" class="btn btn-light social">872 粉丝</a>
                    <a href="#" id="updateUser" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#basicModal">更新个人资料</a>
                </div>
            </div>
            <div class="profile-pic d-flex">
                <img id="img" src="" alt="">
                <div class="profile-info2">
                    <h2 class="mb-0" id="userName"></h2>
                    <h4>程序员</h4>
                    <span class="d-block"><i class="fas fa-map-marker-alt me-2"></i><font>棉兰， 苏门答腊乌达拉 - ID</font></span>
                </div>
            </div>
        </div>
        <div class="col-xl-3 col-xxl-4 col-lg-6 mt-5">
            <div class="row">
                <div class="col-xl-12">
                    <div class="card">
                        <div class="card-header border-0">
                            <h4 class="fs-20">技能</h4>
                        </div>
                        <div class="card-body">
                            <div id="pieChart2" class="mb-4"></div>
                            <div class="progress default-progress">
                                <div class="progress-bar bg-green progress-animated" style="width: 90%; height:13px;" role="progressbar">
                                    <span class="sr-only">90% 完成</span>
                                </div>
                            </div>
                            <div class="d-flex align-items-end mt-2 pb-4 justify-content-between">
                                <span class="fs-14 font-w500">菲格玛</span>
                                <span class="fs-16"><span class="text-black pe-2"></span><font>90%</font></span>
                            </div>
                            <div class="progress default-progress">
                                <div class="progress-bar bg-info progress-animated" style="width: 68%; height:13px;" role="progressbar">
                                    <span class="sr-only">45% 完成</span>
                                </div>
                            </div>
                            <div class="d-flex align-items-end mt-2 pb-4 justify-content-between">
                                <span class="fs-14 font-w500">土坯 XD</span>
                                <span class="fs-16"><span class="text-black pe-2"></span><font>68%</font></span>
                            </div>
                            <div class="progress default-progress">
                                <div class="progress-bar bg-blue progress-animated" style="width: 85%; height:13px;" role="progressbar">
                                    <span class="sr-only">85% 完成</span>
                                </div>
                            </div>
                            <div class="d-flex align-items-end mt-2 pb-4 justify-content-between">
                                <span class="fs-14 font-w500">照片商店</span>
                                <span class="fs-16"><span class="text-black pe-2"></span><font>85%</font></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xl-9 col-xxl-8 col-lg-6 mt-lg-5 mt-0">
            <div class="row">
                <div class="col-xl-8 col-xxl-7">
                    <div class="card">
                        <div class="card-header border-0 pb-0">
                            <h4 class="fs-20 font-w600">关于我</h4>
                        </div>
                        <div class="card-body">
                            <p class="fs-18">Lorem ipsum dolor sit amet， consectetur adipiscing elit， sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Ut enim ad minim veniam， quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.Excepteur sint occaecat cupidatat non proident， sunt in culpa qui officia deserunt mollit anim id est laborum</p>
                            <h4 class="fs-20 font-w600 my-4">联系</h4>
                            <div class="d-flex flex-wrap">
                                <div class="d-flex contacts-social align-items-center mb-3  me-sm-5 me-0">
												<span class="me-3">
													<i class="fas fa-phone-alt"></i>
												</span>
                                    <div>
                                        <span>电话</span>
                                        <h5 class="mb-0 fs-18">1234598765</h5>
                                    </div>
                                </div>
                                <div class="d-flex contacts-social align-items-center mb-3">
												<span class="me-3">
													<i class="fas fa-envelope-open"></i>
												</span>
                                    <div>
                                        <span>电子邮件</span>
                                        <h5 class="mb-0 fs-18">demo@example.com</h5>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="col-xl-4 col-xxl-5">
                    <div class="card">
                        <div class="card-header border-0 pb-0">
                            <h4 class="fs-20 font-w600">社交</h4>
                        </div>
                        <div class="card-body">
                            <div>
                                <a href="javascript:;" class="btn text-start d-block mb-3 bg-facebook light"><i class="fab fa-facebook-f scale5 me-4 text-facebook"></i><font _mstmutation="1" _msthash="3459430" _msttexthash="11410516">/富兰克林123</font></a>
                                <a href="javascript:;" class="btn text-start d-block mb-3 bg-linkedin light"><i class="fab fa-linkedin-in scale5 me-4 text-linkedin"></i><font _mstmutation="1" _msthash="3459547" _msttexthash="11410516">/富兰克林123</font></a>
                                <a href="javascript:;" class="btn text-start d-block mb-3 bg-dribble light"><i class="fab fa-dribbble scale5 me-4 text-dribble"></i><font _mstmutation="1" _msthash="3459664" _msttexthash="11410516">/富兰克林123</font></a>
                                <a href="javascript:;" class="btn text-start d-block mb-3 bg-youtube light"><i class="fab fa-youtube scale5 me-4 text-youtube"></i><font _mstmutation="1" _msthash="3459781" _msttexthash="11410516">/富兰克林123</font></a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xl-12">
                    <div class="card bg-dark">
                        <div class="card-body d-flex align-items-center">
                            <div>
                                <h4 class="fs-20 font-w600 mb-2 text-white">上传您的简历</h4>
                                <p class="text-white mb-0 op6">Lorem ipsum dolor sit amet， consectetur adipiscing elit， sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Ut enim ad minim veniam， quis nostrud exercitation ullamco laboris nisi ut</p>
                            </div>
                            <div class="upload">
                                <a href="javascript:void(0);"><i class="fas fa-arrow-up"></i></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="basicModal" style="display: none;" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title" style="width: 100%;text-align: center">更新个人资料</h3>
                <button type="button" class="btn-close" data-bs-dismiss="modal">
                </button>
            </div>
            <div class="modal-body">
                <form method="post" enctype="multipart/form-data">
                    <div style="display: flex;justify-content: space-around">
                        <div>
                            <img id="picture" style="width: 150px;height: 150px;border-radius: 50%;" src="" alt="">
                            <input id="b" style="display: none" type="file" name="img" class="form-file-input form-control" multiple="multiple">
                        </div>
                        <div>
                            <div class="input-group mb-3" style="margin-top: 26px">
                                <span class="input-group-text">账号</span>
                                <div class="form-file">
                                    <input type="hidden" name="id" class="form-control" readonly>
                                    <input type="text" name="loginId" class="form-control" readonly>
                                </div>
                            </div>

                            <div class="input-group mb-3">
                                <span class="input-group-text">密码</span>
                                <div class="form-file">
                                    <input type="password" name="password" class="form-control">
                                </div>
                            </div>
                        </div>
                    </div>

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger light" data-bs-dismiss="modal">关闭</button>
                <button id="save" type="button" class="btn btn-primary">保存</button>
            </div>
        </div>
    </div>
</div>

<!--**********************************
    Main wrapper end
***********************************-->

<!--**********************************
    Scripts
***********************************-->
<!-- Required vendors -->
<script src="../../static/js/global.min.js"></script>

<script src="../../static/js/jquery.nice-select.min.js"></script>
<script src="hj/js/jquery-form.js"></script>
<script>
    //用户信息
    $.ajax({
        type:'POST',
        url: '/userShow.action',
        success:function (user){
            $('#img').prop('src',user.photoPath);
            $('#picture').prop('src',user.photoPath);
            $('#userName').text(user.loginId);
            $("input[name='id']").val(user.id);//用户编号
            $("input[name='loginId']").val(user.loginId);//用户名
            $("input[name='password']").val(user.password);//密码
        }
    });
    $("#picture").click(function (){
        $('#b').click();
    });
    var saveImg = "";
    $('#b').change(function (){
        $("form").ajaxSubmit({
            type:"post",
            url:"/hj/saveFileImg.action",
            success:function (resultFileView) {
                    $('#picture').prop('src',resultFileView.img);
                    saveImg=resultFileView.img;
            },
            error:function (xhr, msg) {
                alert("文件上传太大了");
            }
        })
    });
    $('#save').click(function (){
        let sysUsersObj = {
            id:$("input[name='id']").val(),
            loginId:$("input[name='loginId']").val(),
            password:$("input[type='password']").val(),
            photoPath:saveImg,
        }
        $.ajax({
            type:'POST',
            contentType:'application/json;charset=utf-8',
            url:'/hj/updateAccount.action',
            data:JSON.stringify(sysUsersObj),
            success:function (resultUser) {
                if(resultUser!=null){
                    $('#basicModal').modal("hide");
                    alert("成功操作一条数据");
                    $('#img').prop('src',resultUser.photoPath);
                    window.parent.$('.img').prop('src',resultUser.photoPath);
                }else {
                    alert("操作一条数据失败");
                }
            },
        })

    });
</script>



<!-- Chart piety plugin files -->


<!-- Dashboard 1 -->




</body>
</html>